<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../lib/jquery-3.4.1.js"></script>
    <style>
    body{
        height:2000px;
        background: red;
    }
    </style>    
</head>
<body>
    <script>
        var scrollHeight=$(document).height();
        var clientHeight=$(window).height();
        $(window).scroll(function(){
            var scrollTop=Math.ceil($(document).scrollTop());
            console.log(scrollTop)
            if(scrollTop+clientHeight>=scrollHeight-1){console.log("到达了底部");}
        })
        // console.log(scrollHeight);
        // console.log(clientHeight);
        </script>
</body>
</html>